<?php  
	if (!isset($_SESSION['LAST_ACTIVITY'])) { 
		// initiate value 
		$_SESSION['LAST_ACTIVITY'] = time(); 
	} 
	if (time() - $_SESSION['LAST_ACTIVITY'] > 600) { 
		// last activity is more than 10 minutes ago 
		session_destroy();
		header("Location: ../index.php?error=5");  
	} else { 
		// update last activity timestamp 
		$_SESSION['LAST_ACTIVITY'] = time(); 
	}
	if(!isset($_SESSION['admitido']) || $_SESSION['admitido'] == false)
		header("Location: ../index.php"); 
?>